<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/html"><head>
    <meta charset="utf-8">
    <title>{include file="common/title"}</title>

    <meta name="description" content="Dashboard">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__DATA__/admin/style/bootstrap.css" rel="stylesheet">
    <link href="__DATA__/admin/style/font-awesome.css" rel="stylesheet">
    <link href="__DATA__/admin/style/weather-icons.css" rel="stylesheet">

    <!--Beyond styles-->
    <link id="beyond-link" href="__DATA__/admin/style/beyond.css" rel="stylesheet" type="text/css">
    <link href="__DATA__/admin/style/demo.css" rel="stylesheet">
    <link href="__DATA__/admin/style/typicons.css" rel="stylesheet">
    <link href="__DATA__/admin/style/animate.css" rel="stylesheet">
</head>
<body>
<!-- 头部 -->
{include file="common/top"}
<!-- /头部 -->

<div class="main-container container-fluid">
    <div class="page-container">
        <!-- Page Sidebar -->
        {include file="common/left"}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li class="active">控制面板</li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->

            <!-- Page Body -->
            <!--正文-->
            <form action="{:url('business/menu/search')}" method="post">
                <div class="input-group col-md-3" style="margin-top:10px;margin-left: 20px;">
                    <input type="text" class="form-control" name="search" placeholder="请输入订单名称" />
                    <span class="input-group-btn">
            <button class="btn btn-info btn-search">搜索</button>
                        <!--<button class="btn btn-info btn-search" style="margin-left:3px">添加</button>-->
            </span>
                </div>
            </form>
            <div class="page-body">
                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <div class="widget">
                            <div class="widget-body">
                                <div class="flip-scroll">
                                    <table class="table table-bordered table-hover">
                                        <thead class="">
                                        <tr>
                                            <th class="text-center">商家名称</th>
                                            <th class="text-center">订单编号</th>
                                            <th class="text-center">联系人名称</th>
                                            <th class="text-center">联系人地址</th>
                                            <th class="text-center">联系人电话</th>
                                            <th class="text-center">支付金额</th>
                                            <th class="text-center">支付时间</th>
                                            <th class="text-center">用户的openId</th>
                                            <th class="text-center">优惠券名称</th>
                                            <th class="text-center">备注信息</th>
                                            <th class="text-center">订单是否支付</th>
                                            <th class="text-center">优惠的价格</th>
                                            <th class="text-center">状态</th>
											<th class="text-center">订单商品</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        {volist name="data" id="v"}
                                        <tr>
                                            <td align="center">{$v.business_name}</td>
                                            <td align="center">{$v.order_num}</td>
                                            <td align="center">{$v.order_name}</td>
                                            <td align="center">{$v.order_address}</td>
                                            <td align="center">{$v.order_tel}</td>
                                            <td align="center">{$v.order_pay}</td>
                                            <td align="center"><?php echo date('Y-m-d H:i:s',$v['order_time']) ?></td>
                                            <td align="center">{$v.openId}</td>
                                            <td align="center">{$v.lessen_name}</td>
                                            <td align="center">{$v.order_remark}</td>
                                            {if condition="$v['order_status'] eq 1 "}
                                            <td align="center" style="color: darkseagreen;">已支付</td>
                                            {else/}
                                            <td align="center" style="color: indianred;">未支付</td>
                                            {/if}
                                            <td align="center">{$v.reducePrice}</td>

                                            {switch name="$v['is_comment']"}
                                                {case value="0"} <td align="center" style="color: darkseagreen;">待接单</td>{/case}
                                                {case value="1"} <td align="center" style="color: darkseagreen;">已接单</td>{/case}
                                                {case value="2"} <td align="center" style="color: darkseagreen;">配送中</td>{/case}
                                                {case value="3"} <td align="center" style="color: darkseagreen;">配送完成</td>{/case}
                                                {case value="4"} <td align="center" style="color: darkseagreen;">已评论</td>{/case}
                                                {case value="5"} <td align="center" style="color: indianred;">已退款</td>{/case}
                                            {/switch}
											<td align="center"><a href="{:url('business/order/order_detail',['order_num' => $v.order_num])}">查看</a>
                                             {if condition="$v['order_status'] eq 1 "}
                                             {if condition="$v['is_comment'] eq 0 "}

                                                | <a href="{:url('business/order/jiedan',['order_num' => $v.order_num])}">接单</a>
                                                {/if}
                                            {/if}
                                            </td>
                                        </tr>
                                        {/volist}
                                        <!-- Modal -->
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--Basic Scripts-->
            <script src="__DATA__/admin/style/jquery_002.js"></script>
            <script src="__DATA__/admin/style/bootstrap.js"></script>
            <script src="__DATA__/admin/style/jquery.js"></script>
            <!--Beyond Scripts-->
            <script src="__DATA__/admin/style/beyond.js"></script>

    <script type="text/javascript">
    myFunction()
    setInterval(function(){
        //console.log('执行！')
        myFunction()

            },120000);

     function myFunction()
        {


                 //alert("Hello")

                   $.ajax({
                    type:"GET",
                    url:"{:url('business/order/tixing')}",
                    dataType:"json",
                    success:function(data){
                        //console.log(data)

                        if(data == 1)
                        {
                             $(function(){
                            var $h1=$("<audio src='__PUBLIC__admin/music/xiaoxi.mp3'  autoplay ></audio>");
                            $("body").append($h1);
                            })
                        }

                    },
                    error:function(jqXHR){
                         console.log('失败！')
                    }
                });


        }
    </script>
            <script>
                $(function(){
                    $('.dingdan').css('display','block');
                });
            </script>
</body></html>